package anaydis.animation.model;

import java.util.List;
import java.util.ArrayList;

public class DescendingDataModel
        extends SortDataModel

{
    private int begin;

    public DescendingDataModel(int begin)
    {
        this.begin = begin;
    }

    public List<Integer> create(int size) 
    {
        final List<Integer> result = initializeEmptyList(size);

        for(int i = 0; i < size; i++)
        {
            result.set(i, size - (i + begin) % size);
        }

        return result;
    }

    public String toString()
    {
        return begin == 0 ? "Descending" : "~Descending";
    }
}